Imports DocumentFormat.OpenXml.Spreadsheet
Imports FineUI
Imports Kimmo
Imports Microsoft.VisualBasic.CompilerServices
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlServerCe
Imports System.Diagnostics
Imports System.Runtime.CompilerServices

''' <summary>
''' This is the beginning of the MyContacts business object to handle interaction between the user interface and the database.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Class clsMyContacts
    Public Property ID As Integer = Val(-1)
    Public Property FirstName As String = ""
    Public Property LastName As String = ""
    Public Property Telephone As String = ""
    Public Property Mobilephone As String = ""
    Public Property DateofBirth As Nullable (of Date) = Nothing
    Public Property Face As String = ""
    Public Property IsLiving As String = ""
    Public Property Country As String = ""
    Public Property IsNew As Boolean = False
    Public Property DateFields As String = "DateofBirth"
    Public Property FieldsToUpdate As String = "ID,FirstName,LastName,Telephone,Mobilephone,DateofBirth,Face,IsLiving,Country"

''' <summary>
''' The new method of the class to create new MyContacts records.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub New()
    MyBase.New()
    Clear()
    IsNew = True
    DateFields = "DateofBirth"
    FieldsToUpdate = "ID,FirstName,LastName,Telephone,Mobilephone,DateofBirth,Face,IsLiving,Country"
End Sub

''' <summary>
''' The Clear method clears all properties of the business object to defaults.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub Clear()
    ID = Val(-1)
    FirstName = ""
    LastName = ""
    Telephone = ""
    Mobilephone = ""
    DateofBirth = Nothing
    Face = ""
    IsLiving = ""
    Country = ""
End Sub

''' <summary>
''' Delete MyContacts records specified by a list of ID.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Sub Delete(ByRef Records As List(Of String))
        For Each rsStr As String In Records
            SQLCompact.RunQuery("delete from [MyContacts] where ID = " & rsStr, True)
        Next
    End Sub


''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByID(ByVal intID As Integer)
    SQLCompact.RunQuery("Delete from [MyContacts] where [ID] = " & intID)
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfID(ByRef Records As List(Of String))
        For Each intID As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [ID] = " & intID)
        Next
End Sub

''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByFirstName(ByVal strFirstName As String)
    SQLCompact.RunQuery("Delete from [MyContacts] where [FirstName] = '" & strFirstName & "'")
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfFirstName(ByRef Records As List(Of String))
        For Each strFirstName As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [FirstName] = '" & strFirstName & "'")
        Next
End Sub

''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByLastName(ByVal strLastName As String)
    SQLCompact.RunQuery("Delete from [MyContacts] where [LastName] = '" & strLastName & "'")
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfLastName(ByRef Records As List(Of String))
        For Each strLastName As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [LastName] = '" & strLastName & "'")
        Next
End Sub

''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByTelephone(ByVal strTelephone As String)
    SQLCompact.RunQuery("Delete from [MyContacts] where [Telephone] = '" & strTelephone & "'")
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfTelephone(ByRef Records As List(Of String))
        For Each strTelephone As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [Telephone] = '" & strTelephone & "'")
        Next
End Sub

''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByMobilephone(ByVal strMobilephone As String)
    SQLCompact.RunQuery("Delete from [MyContacts] where [Mobilephone] = '" & strMobilephone & "'")
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfMobilephone(ByRef Records As List(Of String))
        For Each strMobilephone As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [Mobilephone] = '" & strMobilephone & "'")
        Next
End Sub

''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByDateofBirth(ByVal datDateofBirth As Nullable (of Date))
    SQLCompact.RunQuery("Delete from [MyContacts] where [DateofBirth] = " & datDateofBirth)
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfDateofBirth(ByRef Records As List(Of String))
        For Each datDateofBirth As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [DateofBirth] = " & datDateofBirth)
        Next
End Sub

''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByFace(ByVal strFace As String)
    SQLCompact.RunQuery("Delete from [MyContacts] where [Face] = '" & strFace & "'")
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfFace(ByRef Records As List(Of String))
        For Each strFace As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [Face] = '" & strFace & "'")
        Next
End Sub

''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByIsLiving(ByVal strIsLiving As String)
    SQLCompact.RunQuery("Delete from [MyContacts] where [IsLiving] = '" & strIsLiving & "'")
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfIsLiving(ByRef Records As List(Of String))
        For Each strIsLiving As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [IsLiving] = '" & strIsLiving & "'")
        Next
End Sub

''' <summary>
''' Delete MyContacts records meeting a particular field name criteria. In this case, Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByCountry(ByVal strCountry As String)
    SQLCompact.RunQuery("Delete from [MyContacts] where [Country] = '" & strCountry & "'")
End Sub

''' <summary>
''' Delete MyContacts records from a list of particular field. In this case, Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfCountry(ByRef Records As List(Of String))
        For Each strCountry As String In Records
    SQLCompact.RunQuery("Delete from [MyContacts] where [Country] = '" & strCountry & "'")
        Next
End Sub

''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByID(ByVal intID As Integer) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "ID", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByFirstName(ByVal strFirstName As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "ID", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByID(ByVal intID As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "FirstName", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByLastName(ByVal strLastName As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "ID", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByID(ByVal intID As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "LastName", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByTelephone(ByVal strTelephone As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "ID", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByID(ByVal intID As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "Telephone", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByMobilephone(ByVal strMobilephone As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "ID", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByID(ByVal intID As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "Mobilephone", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "ID", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByID(ByVal intID As Integer) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "DateofBirth", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByFace(ByVal strFace As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "ID", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByID(ByVal intID As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "Face", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByIsLiving(ByVal strIsLiving As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "ID", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByID(ByVal intID As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "IsLiving", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.ID based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IDByCountry(ByVal strCountry As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "ID", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByID(ByVal intID As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "ID", intID, "Country", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByFirstName(ByVal strFirstName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "FirstName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByLastName(ByVal strLastName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "FirstName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByFirstName(ByVal strFirstName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "LastName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByTelephone(ByVal strTelephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "FirstName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByFirstName(ByVal strFirstName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "Telephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByMobilephone(ByVal strMobilephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "FirstName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByFirstName(ByVal strFirstName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "Mobilephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "FirstName", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByFirstName(ByVal strFirstName As String) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "DateofBirth", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByFace(ByVal strFace As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "FirstName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByFirstName(ByVal strFirstName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "Face", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByIsLiving(ByVal strIsLiving As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "FirstName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByFirstName(ByVal strFirstName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "IsLiving", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.FirstName based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FirstNameByCountry(ByVal strCountry As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "FirstName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByFirstName(ByVal strFirstName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "FirstName", strFirstName, "Country", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByLastName(ByVal strLastName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "LastName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByTelephone(ByVal strTelephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "LastName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByLastName(ByVal strLastName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "Telephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByMobilephone(ByVal strMobilephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "LastName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByLastName(ByVal strLastName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "Mobilephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "LastName", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByLastName(ByVal strLastName As String) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "DateofBirth", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByFace(ByVal strFace As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "LastName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByLastName(ByVal strLastName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "Face", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByIsLiving(ByVal strIsLiving As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "LastName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByLastName(ByVal strLastName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "IsLiving", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.LastName based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function LastNameByCountry(ByVal strCountry As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "LastName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByLastName(ByVal strLastName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "LastName", strLastName, "Country", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByTelephone(ByVal strTelephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "Telephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByMobilephone(ByVal strMobilephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "Telephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByTelephone(ByVal strTelephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "Mobilephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "Telephone", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByTelephone(ByVal strTelephone As String) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "DateofBirth", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByFace(ByVal strFace As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "Telephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByTelephone(ByVal strTelephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "Face", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByIsLiving(ByVal strIsLiving As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "Telephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByTelephone(ByVal strTelephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "IsLiving", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Telephone based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function TelephoneByCountry(ByVal strCountry As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "Telephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByTelephone(ByVal strTelephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Telephone", strTelephone, "Country", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByMobilephone(ByVal strMobilephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "Mobilephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "Mobilephone", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByMobilephone(ByVal strMobilephone As String) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "DateofBirth", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByFace(ByVal strFace As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "Mobilephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByMobilephone(ByVal strMobilephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "Face", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByIsLiving(ByVal strIsLiving As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "Mobilephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByMobilephone(ByVal strMobilephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "IsLiving", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Mobilephone based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function MobilephoneByCountry(ByVal strCountry As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "Mobilephone", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByMobilephone(ByVal strMobilephone As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Mobilephone", strMobilephone, "Country", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "DateofBirth", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByFace(ByVal strFace As String) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "DateofBirth", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "Face", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByIsLiving(ByVal strIsLiving As String) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "DateofBirth", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "IsLiving", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.DateofBirth based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function DateofBirthByCountry(ByVal strCountry As String) As Nullable (of Date)
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "DateofBirth", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return IIf((IsDate(mv) = True), CDate(mv), Nothing)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "DateofBirth", datDateofBirth, "Country", ";", "Nullable (of Date)")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByFace(ByVal strFace As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "Face", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByIsLiving(ByVal strIsLiving As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "Face", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByFace(ByVal strFace As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "IsLiving", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Face based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FaceByCountry(ByVal strCountry As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "Face", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByFace(ByVal strFace As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Face", strFace, "Country", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByIsLiving(ByVal strIsLiving As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "IsLiving", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.IsLiving based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IsLivingByCountry(ByVal strCountry As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "IsLiving", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByIsLiving(ByVal strIsLiving As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "IsLiving", strIsLiving, "Country", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return MyContacts.Country based on MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountryByCountry(ByVal strCountry As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("MyContacts", "Country", strCountry, "Country", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function IDList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "ID", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function FirstNameList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "FirstName", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function LastNameList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "LastName", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function TelephoneList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "Telephone", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function MobilephoneList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "Mobilephone", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function DateofBirthList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "DateofBirth", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function FaceList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "Face", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function IsLivingList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "IsLiving", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function CountryList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("MyContacts", "Country", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the total number of records in the table MyContacts
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function Count() As Integer
Dim nRecords As Integer = 0
Dim dt As DataTable = SQLCompact.OpenDataTable("select Count(ID) as Records from [MyContacts]")
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function


''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByID(ByVal intID As Integer) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [ID] = " & intID
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByFirstName(ByVal strFirstName As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [FirstName] = '" & strFirstName & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByLastName(ByVal strLastName As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [LastName] = '" & strLastName & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByTelephone(ByVal strTelephone As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [Telephone] = '" & strTelephone & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByMobilephone(ByVal strMobilephone As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [Mobilephone] = '" & strMobilephone & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [DateofBirth] = " & datDateofBirth
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByFace(ByVal strFace As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [Face] = '" & strFace & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByIsLiving(ByVal strIsLiving As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [IsLiving] = '" & strIsLiving & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case MyContacts.Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByCountry(ByVal strCountry As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [MyContacts] where [Country] = '" & strCountry & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function Exists(ByVal intID as Integer) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "ID", intID, "Long")
Return flag
End Function


''' <summary>
''' Return True or False if a particular MyContacts record exists based on ID
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByID(ByVal intID As Integer) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "ID", intID, "Integer")
Return flag
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists based on FirstName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByFirstName(ByVal strFirstName As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "FirstName", strFirstName, "String")
Return flag
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists based on LastName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByLastName(ByVal strLastName As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "LastName", strLastName, "String")
Return flag
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists based on Telephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByTelephone(ByVal strTelephone As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "Telephone", strTelephone, "String")
Return flag
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists based on Mobilephone
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByMobilephone(ByVal strMobilephone As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "Mobilephone", strMobilephone, "String")
Return flag
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists based on DateofBirth
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByDateofBirth(ByVal datDateofBirth As Nullable (of Date)) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "DateofBirth", datDateofBirth, "Nullable (of Date)")
Return flag
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists based on Face
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByFace(ByVal strFace As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "Face", strFace, "String")
Return flag
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists based on IsLiving
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByIsLiving(ByVal strIsLiving As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "IsLiving", strIsLiving, "String")
Return flag
End Function

''' <summary>
''' Return True or False if a particular MyContacts record exists based on Country
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByCountry(ByVal strCountry As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("MyContacts", "Country", strCountry, "String")
Return flag
End Function

''' <summary>
''' Read Method to read MyContacts record from the database using a primarykey.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub Read(ByVal sID As String)
Try
Clear()
Dim nRead As New DataSet()
nRead = SQLCompact.RecordSeek("MyContacts", "ID", sID, "*", "Integer")
Dim xCount As Boolean = nRead.Tables(0).Rows.Count - 1 <> -1
If xCount Then
Dim xRow As DataRow = nRead.Tables(0).Rows(0)
ID = Val(xRow("ID").ToString)
FirstName = xRow("FirstName").ToString
LastName = xRow("LastName").ToString
Telephone = xRow("Telephone").ToString
Mobilephone = xRow("Mobilephone").ToString
DateofBirth = IIf((IsDate(xRow("DateofBirth").ToString) = True), CDate(xRow("DateofBirth").ToString), Nothing)
Face = xRow("Face").ToString
IsLiving = xRow("IsLiving").ToString
Country = xRow("Country").ToString
Me.IsNew = False
nRead.Dispose()
End If
Catch exc as Exception
Throw new Exception(exc.Message)
End Try
End Sub

''' <summary>
''' Save a MyContacts record to the database using a primary key. This uses a property get and FieldsToUpdate, DateFields to update the database.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub Save()
Try
Dim strTable As String = "MyContacts"
Dim strPriKey As String = "ID"
Dim CommText As String = ""
Dim xCommand As New SqlCeCommand
If ID = -1 Then
ID = SQLCompact.TableMaxValue(strTable, strPriKey, "") + 1
IsNew = True
Else
IsNew = False
End If
If FieldsToUpdate = "*" Then
FieldsToUpdate = SQLCompact.Table_FieldNames(strTable, False, ",")
End If
FieldsToUpdate = clsDL.MvRemoveDuplicates(Me.FieldsToUpdate, ",")
Dim strParameters As String = clsDL.MvPrefixBy(FieldsToUpdate, "@", ",")
If IsNew Then
CommText = clsDL.BuildInsertCommand(strTable, FieldsToUpdate, ",")
Else
CommText = clsDL.BuildUpdateCommand(strTable, FieldsToUpdate, strPriKey, ",")
End If
xCommand = SQLCompact.OpenCommand(CommText)
Dim spFields() As String = Split(FieldsToUpdate, ",")
With xCommand
.Parameters.Clear()
For each strField As String In spFields
Dim datePos As Integer = clsDL.MvSearch(DateFields, strField, ",")
If datePos > 0 Then
Dim strValue as string = clsDL.PropertyGet(Me, strField).ToString
.Parameters.AddWithValue("@" & strField, IIf((IsDate(strValue) = True), CDate(strValue), DBNull.Value))
Else
.Parameters.AddWithValue("@" & strField, clsDL.PropertyGet(Me, strField))
End If
Next
.ExecuteNonQuery()
End With
SQLCompact.Connection.Close()
xCommand.Dispose()
Catch exc as Exception
Throw new Exception(exc.Message)
End Try
End Sub

''' <summary>
''' This method builds up an editable grid based on selected records. The grid has Save, Clone and Delete buttons
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub ShowMyContacts(ByRef grdViews As FineUI.Grid, ByVal strFilter As String)
clsFineUI.Grid.Clear(grdViews, "", "")
clsFineUI.Grid.TableName = "MyContacts"
clsFineUI.Grid.DataKeyNames = "ID"
clsFineUI.Grid.PageSize = 50
clsFineUI.Grid.AllowPaging = True
clsFineUI.Grid.AllowSorting = True
clsFineUI.Grid.LoadMask = False
clsFineUI.Grid.Title = "MyContacts"
clsFineUI.Grid.ShowBorder = False
clsFineUI.Grid.ShowHeader = False
clsFineUI.Grid.EnableRowNumber = False
clsFineUI.Grid.AutoHeight = True
clsFineUI.Grid.AutoPostBack = False
clsFineUI.Grid.EnableCheckBoxSelect = True
clsFineUI.Grid.AutoWidth = True
clsFineUI.Grid.EnableAlternateRowColor = True
clsFineUI.Grid.EnableCollapse = False
clsFineUI.Grid.EnableMouseOverColor = True
clsFineUI.Grid.EnableMultiSelect = True
clsFineUI.Grid.EnableViewState = True
clsFineUI.Grid.EnableAjax = True
clsFineUI.Grid.ColumnLines = True
clsFineUI.Grid.ToolTipField = "FirstName"
clsFineUI.Grid.IsDatabasePaging = False
clsFineUI.Grid.ShowGridHeader = True
clsFineUI.Grid.EnableHeaderMenu = True
clsFineUI.Grid.EnableColumnHide = True
clsFineUI.Grid.AddColumn("ID", "ID", "{0}", "", "", False, "50", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddTextBox("FirstName", "First Name", "{0}", "", "100", FineUi.TextAlign.Left, False, False, True)
clsFineUI.Grid.AddTextBox("LastName", "Last Name", "{0}", "", "100", FineUi.TextAlign.Left, False, False, True)
clsFineUI.Grid.AddTextBox("Telephone", "Telephone", "{0}", "", "100", FineUi.TextAlign.Left, False, False, True)
clsFineUI.Grid.AddTextBox("Mobilephone", "Mobilephone", "{0}", "", "100", FineUi.TextAlign.Left, False, False, True)
clsFineUI.Grid.AddTextBox("DateofBirth", "Date of Birth", "{0:dd/MM/yyyy}", "", "100", FineUi.TextAlign.Left, False, False, True)
clsFineUI.Grid.AddImage("Face", "Face", "~/images/{0}.gif", "100", FineUi.TextAlign.Left, False, "100", "100")
clsFineUI.Grid.AddCheckBoxWeb("IsLiving", "Is Living", "", "100")
clsFineUI.Grid.AddComboBox("Country", "Country", "{0}", "", "100", FineUi.TextAlign.Left, False, Nothing)
clsFineUI.Grid.AddSave()
clsFineUI.Grid.AddClone()
clsFineUI.Grid.AddDelete()
If Len(strFilter) > 0 Then clsFineUI.Grid.Filter = strFilter
clsFineUI.Grid.OrderBy = "ID"
clsFineUI.Grid.BuildSelectCommand()
clsFineUI.Grid.UseSQLCompact = True
clsFineUI.Grid.Update(Nothing)
End Sub

''' <summary>
''' Builds a readonly grid based on selected records, this grid has Edit, Clone, Delete, Like and Comment buttons.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub ShowGrid(ByRef grdViews As FineUI.Grid, ByVal strFilter As String)
clsFineUI.Grid.Clear(grdViews, "", "")
clsFineUI.Grid.TableName = "MyContacts"
clsFineUI.Grid.DataKeyNames = "ID"
clsFineUI.Grid.PageSize = 50
clsFineUI.Grid.AllowPaging = True
clsFineUI.Grid.AllowSorting = True
clsFineUI.Grid.LoadMask = False
clsFineUI.Grid.Title = "MyContacts"
clsFineUI.Grid.ShowBorder = False
clsFineUI.Grid.ShowHeader = False
clsFineUI.Grid.EnableRowNumber = False
clsFineUI.Grid.AutoHeight = True
clsFineUI.Grid.AutoPostBack = False
clsFineUI.Grid.EnableCheckBoxSelect = True
clsFineUI.Grid.AutoWidth = True
clsFineUI.Grid.EnableAlternateRowColor = True
clsFineUI.Grid.EnableCollapse = False
clsFineUI.Grid.EnableMouseOverColor = True
clsFineUI.Grid.EnableMultiSelect = True
clsFineUI.Grid.EnableViewState = True
clsFineUI.Grid.EnableAjax = True
clsFineUI.Grid.ColumnLines = True
clsFineUI.Grid.ToolTipField = "FirstName"
clsFineUI.Grid.IsDatabasePaging = False
clsFineUI.Grid.ShowGridHeader = True
clsFineUI.Grid.EnableHeaderMenu = True
clsFineUI.Grid.EnableColumnHide = True
clsFineUI.Grid.AddColumn("ID", "ID", "{0}", "", "", False, "50", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddColumn("FirstName", "First Name", "{0}", "", "", True, "100", FineUi.TextAlign.Left, True)
clsFineUI.Grid.AddColumn("LastName", "Last Name", "{0}", "", "", False, "100", FineUi.TextAlign.Left, True)
clsFineUI.Grid.AddColumn("Telephone", "Telephone", "{0}", "", "", False, "100", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddColumn("Mobilephone", "Mobilephone", "{0}", "", "", False, "100", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddColumn("DateofBirth", "Date of Birth", "{0:dd/MM/yyyy}", "", "", False, "100", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddColumn("Face", "Face", "~/images/{0}.gif", "", "", False, "100", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddColumn("IsLiving", "Is Living", "{0}", "", "", False, "100", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddColumn("Country", "Country", "{0}", "", "", False, "100", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddEditCloneDelete()
clsFineUI.Grid.AddLikeComment()
If Len(strFilter) > 0 Then clsFineUI.Grid.Filter = strFilter
clsFineUI.Grid.OrderBy = "ID"
clsFineUI.Grid.BuildSelectCommand()
clsFineUI.Grid.UseSQLCompact = True
clsFineUI.Grid.Update(Nothing)
End Sub

''' <summary>
''' Import MyContacts records from a csv file.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub ImportFile(ByVal SourceFile As String, ByVal FileData As String)
Try
Dim spLines As String() = Strings.Split(FileData, vbCr & vbLf)
For each strLine As String In spLines
strLine = strLine.Trim
If Len(strLine) > 0 Then
Dim spLine As String() = Strings.Split(strLine, ",")
Dim clsNewMyContacts As New clsMyContacts
With clsNewMyContacts
.IsNew = True
.ID = -1
.Save
End With
End If
Next
Catch exc as exception
Throw new Exception(exc.message)
End Try
End Sub

''' <summary>
''' Define a blank MyContacts record and save it in a database. This method is useful for a grid like interface.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub Blank()
Dim clsNewMyContacts As New clsMyContacts
clsNewMyContacts.Clear()
clsNewMyContacts.IsNew = True
clsNewMyContacts.ID = -1
clsNewMyContacts.Save
clsNewMyContacts = Nothing
End Sub
End Class

